<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<style>
<!--

.pageFormContent p{
	height: auto;
}
-->
</style>

<script type="text/javascript">
<!--
function dialogAjaxDone(json){
	DWZ.ajaxDone(json);
	if (json.statusCode == DWZ.statusCode.ok){
		loadOrderItemList();
		if ("closeCurrent" == json.callbackType) {
			$.pdialog.closeCurrent();
		}
	}
}
//-->
</script>
<div class="pageContent">
	<form method="post" action="<c:url value="/orders/saveOrUpdateOrderItem.do"/>" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<p>
			<c:if test="${type!='view' }">
				<label>请选择产品：</label>
				<input type="hidden" name="orderItemForm.orderId" value="${orderId}">
				<input type="hidden" name="orderItemForm.orderItemId" value="${orderItem.id}">
				<a class="btnLook" href="<c:url value="/orders/listProduct.do"/>" lookupGroup="orderItemForm" rel="productLookup">查找带回</a>
				<span class="inputInfo">请点击选择产品...</span>	
				${type}
				</c:if>
			</p>
			<div style="clear: left;"></div>
			<p>
				<label>产品图示：</label>
				<input name="orderItemForm.id"  class="required" type="hidden" size="25" value="${orderItem.product.id}" title="请选择产品"/>
				<img id="doorImag" name="orderItemForm.imagePath" src="<c:url value="${orderItem.product.imagePath}"/>" style="height:250px;float: left;">
			</p>
			<p>
				<label>名称及型号：</label>
				<input name="orderItemForm.name" class="required" type="text" size="30" readonly="readonly" value="${orderItem.product.name}" title="请填写产品名称"/>
			</p>
			<p>
				<label>采购数量：</label>
				<input name="orderItemForm.amount"  class="digits required" type="text" size="25" value="<c:out value="${orderItem.amount}" default="1" />"  title="请填写采购数量"/>
				<span class="inputInfo">（扇）</span>
			</p>
			
			<p>
				<label>高度：</label>
				<input name="orderItemForm.height"  class="number required" type="text" size="25" value="${orderItem.height}" title="请填写高度" />
				<span class="inputInfo">（米）</span>
			</p>
			<p>
				<label>宽度：</label>
				<input name="orderItemForm.width"  class="number required" type="text" size="25" value="${orderItem.width}" title="请填写宽度"/>
				<span class="inputInfo">（米）</span>
			</p>
			<p>
				<label>厚度：</label>
				<input name="orderItemForm.length"  class="number required" type="text" size="25" value="${orderItem.length}" title="请填写厚度"/>
				<span class="inputInfo">（米）</span>
			</p>
			<p>
				<label>颜色图示：</label>
				<input name="orderItemForm.colorId" type="hidden" size="25" value="${orderItem.color.id}"/>
				<img id="doorImag" name="orderItemForm.colorImgPath" src="<c:url value="${orderItem.color.imagePath}"/>" style="width:50px;height:50px;float: left;">
				<c:if test="${type!='view' }">
				<a class="btnLook" href="<c:url value="/orders/listColor.do"/>" lookupGroup="orderItemForm">查找带回</a>	
				</c:if>
			</p>
			<p>
				<label>颜色名称：</label>
				<input name="orderItemForm.colorDesc"  type="text" size="30" readonly="readonly" value="${orderItem.color.description}"/>
			</p>
		</div>
		<div class="formBar">
			<ul>
				<c:if test="${type!='view' }">
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				</c:if>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
